<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>AJAX练习</title>
<style type="text/css">
<!--
.style1 {font-size: 24px}
-->
</style>
<script language="JavaScript">
var banben;
var no = 0;
var no1=0;
function yanzheng(){
	if(window.ActiveXObject){
		banben=new ActiveXObject("Microsoft.XMLHTTP");
	}
	else{
		alert("请用IE浏览器");
	}
}

function deletestart(){
yanzheng();
var id=document.getElementById("delete1").value;

banben.onreadystatechange=deletejieshou;
banben.open("GET","deleteusers.jsp?ids="+id,false);
banben.send();
}
function deletejieshou(){
	if(banben.readystate == 4){
		if(banben.status == 200){
			document.getElementById("jieguo").innerHTML=banben.responseText;			
		}
	
	}

}
function selectstart(){
	yanzheng();
	banben.onreadystatechange=selectjieshou;
	banben.open("GET","selectbiaos.jsp"+"?no="+no,false);
	no ++;
	banben.send();
	

}
function selectjieshou(){
	if(banben.readyState == 4){
		if(banben.status == 200){
			document.getElementById("jieguo").innerHTML=banben.responseText;
		}
	
	}

}

function insertstart(){
	var name=document.getElementById("zhuceusers").value;
	var pwd=document.getElementById("zhucepwds").value;
	var emile=document.getElementById("zhuceemiles").value;
	yanzheng();	
	banben.onreadystatechange=insertjieshou;
	banben.open("GET","insertusers.jsp?names="+name+"&pwds="+pwd+"&emile1="+emile,false);
	
	banben.send();
}

function insertjieshou(){
	if(banben.readyState == 4){
		if(banben.status == 200){
			document.getElementById("jieguo").innerHTML=banben.responseText;
		}
	}
}

function showdate(){
	var Mydate=new Date();
	var now =Mydate.getYear()+"年";
	now=now+Mydate.getHours()+"时"
	now=now+Mydate.getMinutes()+"分"
	now=now+Mydate.getSeconds()+"秒"; 
	document.getElementById("nowdate").innerHTML=now;
	setTimeout("showdate()",1000);
}	

</script>
</head>

<body onLoad="showdate()">

  <table width="703" height="402" border="1" align="center" cellspacing="0">
    <div align="center"></div>
    <tr>
      <th width="82" height="127" scope="col">&nbsp;</th>
      <th width="87" scope="col">&nbsp;</th>
      <th colspan="3" scope="col"><span class="style1">欢迎来到会员管理页面！</span></th>
      <th width="86" scope="col">&nbsp;</th>
      <th width="78" scope="col">&nbsp;</th>
    </tr>
    <tr>
      <td colspan="7"><p></p>
      <p><form name="form1" method="post" action="" onsubmit="return yanzheng1()">
  <table width="691" height="195" border="1" align="center" cellspacing="0">
    <tr bgcolor="#FFFF00">
      <th colspan="2" scope="col"><span class="style3">添加用户！</span></th>
    </tr>
    <tr>
      <td width="175"><span class="style5">请填写用户：</span></td>
      <td width="226"><input name="zhuceuser" type="text" id="zhuceusers" value="wx_1118"></td>
    </tr>
    <tr>
      <td><span class="style5">请填写密码：</span></td>
      <td><input name="zhucepwd" type="password" id="zhucepwds" value="wx_1118"></td>
    </tr>
    <tr>
      <td><span class="style5">请填写邮箱：</span></td>
      <td><input name="zhuceemile" type="text" id="zhuceemiles" value="wx_1118@sohu.com"></td>
    </tr>
    <tr>
      <td><div align="center">
        <input type="button" name="Submit" value="添加" onClick="insertstart()">
      </div></td>
      <td><div align="center">
        <input type="reset" name="Submit2" value="重置">
      </div></td>
    </tr>
  </table>
</form>
      <form name="form3" method="post" action="">
        <table width="200" border="0" align="center" cellspacing="0">
          <tr>
            <td><div align="center" id="nowdate"></div></td>
          </tr>
        </table>
        <p align="center">
          <input type="button" name="Submit3" value="查询" id="selectbiao" onClick="selectstart()">
        </p>
        <p align="center">&nbsp;&nbsp;请选择要删除的用户编号：
          <input type="text" name="bianhao" id="delete1">
          &nbsp;
          <input type="button" name="Submit4" value="删除" id="deletebiao" onClick="deletestart()">
&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;&nbsp;        </p>
      </form>      <p><div id="jieguo" align="center">这里返回结果！</div></p>

</body>
</html>